package com.ysh.spring.advice;

import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

/**
 * 袁胜虎 on 2022/9/26 22:43
 */
public class tranAdvice implements MethodBeforeAdvice, AfterReturningAdvice {
    @Override
    public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {

        System.err.println("提交事物");

    }

    @Override
    public void before(Method method, Object[] args, Object target) throws Throwable {

        System.err.println("开启事物了!!");
    }
}
